package com.excesys.exsecs.energy.service;

import cn.hutool.core.lang.tree.Tree;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.excesys.exsecs.energy.entity.DevDeptMap;
import com.excesys.exsecs.energy.entity.DimDept;

import java.util.List;
import java.util.Map;

public interface DimDeptService extends IService<DimDept> {

    List<Tree<Long>> queryTree(DimDept dimDept);

    DimDept getDeptById(Long id);

    /**
     * 保存或更新部门与关联表计的关系
     */
    boolean saveDevDeptMap(DimDept dimDept);

    /**
     * 删除部门及关联表计关系和分区关系
     */
    boolean removeDeptBatchByIds(List<Long> ids);

    List<DevDeptMap> getMetersById(DimDept dimDept);

    JSONObject powerDepSanchitou(String id, String startDate, String endDate);

    JSONObject powerDepBingtu(String startDate, String endDate);

    /*
     * 部门能耗报表
     * */
    List<Map<String, Object>> getDeptReportPage(String ids, String date);

    /*
     * 部门能耗对比
     * */
    JSONObject powerDeptContrast(String ids, String startDate, String endDate);

    /*
     * 部门能耗排序
     * */
    List<Map<String, Object>> deptSort(String ids, String startDate, String endDate, String order, String energyType);
    /*
     * 部门能耗排序 - 水
     * */
    List<Map<String, Object>> deptSortWaterRank(String ids, String startDate, String endDate, String order, String energyType);
}